package com.shicijiaoliu.mapper;

import com.shicijiaoliu.pojo.Author;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Authormapper {

    @Insert("insert into author(name,Bi,dynasty)" +
    " value(#{name},#{bi},#{dynasty})")
    void add(Author author);

    @Select("select * from author where name = #{name}")
    Author findByname(String name);

    List<Author> findauthorBypage(String name,String dynasty);

    int getcount(String name,String dynasty);

    @Update("update author set name=#{name},Bi=#{bi},dynasty=#{dynasty} where ID=#{id}")
    void updateauthor(Author author);

    @Select("select * from author where ID=#{id}")
    Author findByid(long id);


    @Delete("delete from author where ID=#{id}")
    void delauthor(long id);
}
